#pragma once
#include <iostream>
using namespace std;
class Date
{
private:
	int _year;
	int _month;
	int _day;
public:
	int GetMonthDay(int year, int month)
	{
		static int MonthDay[] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
		if (month == 2 && 
			((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))
		{
			return 29;
		}
		return MonthDay[month];
	}
	void Print();
	Date(int year = 1900, int month = 1, int day = 1);
	Date& operator=(const Date& d);
	Date& operator+=(int day);
	Date& operator-=(int day);
	Date operator+(int day);
	Date operator-(int day);
	bool operator==(const Date& d);
	bool operator>(const Date& d);
	bool operator >= (const Date& d);
	bool operator < (const Date& d);
	bool operator <=(const Date& d);
	bool operator != (const Date& d);
	Date operator++(int);
	Date& operator++();
	Date operator--(int);
	Date& operator--();
	int operator-(const Date& d);
};